import { IContext, IParam } from '../../common';
import { ICtrlActionResult } from '../data-action';
import { IMDCtrlModel } from '../model';
import { IDECtrlAbility } from './i-de-ctrl-ability';

/**
 *  多数据部件能力接口
 *
 * @export
 * @interface IDECtrlAbility
 * @extends {ICtrlAbility}
 */
export interface IMDCtrlAbility<T extends IMDCtrlModel = IMDCtrlModel>
	extends IDECtrlAbility {
	/**
	 * 选择全部
	 *
	 * @memberof IMDCtrlAbility
	 */
	selectAll(): void;

	/**
	 * 选中数据
	 *
	 * @param {IParam[]} items 需要选中的数据
	 * @param {boolean} [reverse] 是否反选
	 * @memberof IMDCtrlAbility
	 */
	selectItems(items: IParam[], reverse?: boolean): void;

	/**
	 * 导出Excel
	 *
	 * @param {IParam} [opt]
	 * @memberof IMDCtrlAbility
	 */
	exportExcel(opt?: IParam): void;

	/**
	 * 删除数据
	 *
	 * @param {IParam} [datas]
	 * @return {*}  {Promise<ICtrlActionResult>}
	 * @memberof IMDCtrlAbility
	 */
	remove(datas?: IParam[]): Promise<ICtrlActionResult>;
}
